package com.study.model.pojo.HRpojo;

import java.io.Serializable;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.HashSet;
import java.util.List;
import java.util.Set;


/**
 * The persistent class for the role_tab database table.
 * 
 */
@Entity
@Table(name="role_tab")
@NamedQuery(name="RoleTab.findAll", query="SELECT r FROM RoleTab r")
public class RoleTab implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int roleid;

	private String description;

	private String rolename;

	//bi-directional many-to-many association to EmpTab
	@JsonIgnore
	@ManyToMany(mappedBy="roleTabs")//不维护中间表
	private Set<EmpTab> empTabs = new HashSet<EmpTab>(0);

	//bi-directional many-to-many association to PermissionTab
	@JsonIgnore
	@ManyToMany
	@JoinTable(
    name="role_permission",//中间表名
    joinColumns={@JoinColumn(name="roleid")},//当前对象id在中间表的列名
    inverseJoinColumns={@JoinColumn(name="permid")}//关联的另一个表在中间表的列名
   )
	private Set<PermissionTab> permissionTabs = new HashSet<PermissionTab>(0);

	public RoleTab() {
	}

	public int getRoleid() {
		return this.roleid;
	}

	public void setRoleid(int roleid) {
		this.roleid = roleid;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getRolename() {
		return this.rolename;
	}

	public void setRolename(String rolename) {
		this.rolename = rolename;
	}

	public Set<EmpTab> getEmpTabs() {
		return this.empTabs;
	}

	public void setEmpTabs(Set<EmpTab> empTabs) {
		this.empTabs = empTabs;
	}

	public Set<PermissionTab> getPermissionTabs() {
		return this.permissionTabs;
	}

	public void setPermissionTabs(Set<PermissionTab> permissionTabs) {
		this.permissionTabs = permissionTabs;
	}

}